package com.example.myspringboot.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zheng
 */
@Controller
@RequestMapping("/kafka-message")
public class TestKafkaController {

    @Autowired
    private KafkaMessageProducer kafkaMessageProducer;

    @GetMapping("/publish")
    public void publishAdminMessage(@RequestParam("message") String message) {
        kafkaMessageProducer.sendAdminMessage(message);
    }

}
